home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Herois / Codigo.Cst / 00131_Midias-Selecao.ls < prev    next >
Encoding:
Text File  |  1999-03-19  |  2.5 KB  |  106 lines

  1. property spr
  2. property ligado  -- se esta ligado, i.e., a midia esta disponivel
  3. property aceso   -- quando mouse passa por cima 
  4. property sel     -- selecionado
  5. property sprBase -- Primeiro dos botoes
  6.  
  7. on beginSprite me
  8.   set sprBase = 79
  9.   set spr = the spriteNum of me
  10.   set ligado = the visibility of sprite spr
  11.   set aceso = false
  12.   set sel = false
  13.   puppetSprite spr, true
  14. end
  15.  
  16. on mouseUp me
  17.   global gMidiaSelecionada
  18.   
  19.   set sel = true
  20.   global gFotoCodes
  21.   
  22.   case spr of
  23.     sprBase: 
  24.       set tmp = 2
  25.       set fotoCode = getAt(gFotoCodes,1)
  26.     (sprBase+1): 
  27.       set tmp = 4
  28.       set fotoCode = getAt(gFotoCodes,2)
  29.     (sprBase+2): 
  30.       set tmp = 8
  31.       set fotoCode = getAt(gFotoCodes,3)
  32.     (sprBase+3): 
  33.       set tmp = 16
  34.       set fotoCode = getAt(gFotoCodes,4)
  35.   end case
  36.   if fotoCode <> "filenotfound" then
  37.     if fotoCode <> the name of member 5 then
  38.       global gSepPath
  39.       importFileInto member 5, ┬¼
  40.                 the moviePath & "Fotos" & gSepPath & fotoCode & ".jpg"
  41.       set the member of sprite 86 to 5
  42.     end if
  43.   end if
  44.   
  45.   if gMidiaSelecionada <> tmp then
  46.     puppetSound 2, "CliqueMidia"
  47.     set gMidiaSelecionada = tmp
  48.     
  49.     -- Deseleciona outras midias
  50.     set memNormal = the number of member "Midias01"
  51.     repeat with i = sprBase to (sprBase+3)
  52.       if i <> spr then
  53.         set the member of sprite i to member (memNormal+i-sprBase)
  54.         set the sel of sprite i to false
  55.       end if
  56.     end repeat
  57.     
  58.     -- Desliga
  59.     repeat with i = 65 to 76
  60.       set the visibility of sprite i to false
  61.     end repeat
  62.     updateStage
  63.     
  64.     -- Lista
  65.     set gMidiaSelecionada = tmp
  66.     listaMidiasSubTextos 0, true
  67.     
  68.     -- Religa
  69.     repeat with i = 65 to 76
  70.       set the visibility of sprite i to true
  71.     end repeat
  72.     set the visibility of sprite 78 to true -- Midia Linhas
  73.     set the visibility of sprite 48 to true
  74.     set the visibility of sprite 93 to true
  75.   end if
  76.   updateStage
  77. end
  78.  
  79. on idleSprite me
  80.   if not ligado then return
  81.   
  82.   global gCritico
  83.   if gCritico > 0 then return
  84.   
  85.   if rollOver(spr) then
  86.     set tmp=true
  87.   else 
  88.     set tmp=false
  89.   end if
  90.   
  91.   if tmp <> aceso then
  92.     set aceso = tmp
  93.     if aceso then
  94.       set the member of sprite spr to ┬¼
  95.          (the number of member "Midias03") + spr - sprBase
  96.     else
  97.       if sel then
  98.         set the member of sprite spr to ┬¼
  99.          (the number of member "Midias02") + spr - sprBase
  100.       else
  101.         set the member of sprite spr to ┬¼
  102.          (the number of member "Midias01") + spr - sprBase
  103.       end if
  104.     end if
  105.   end if
  106. end